package com.tarena.lbs.business.controller;

import com.tarena.lbs.base.protocol.model.Result;
import com.tarena.lbs.business.dao.repository.BusinessCategoryRepository;
import com.tarena.lbs.business.pojo.vo.BusinessCategoryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Slf4j
@Api(tags = "商家分类相关功能接口")
@RestController
public class  BusinessCategoryController {
    @Autowired
    private BusinessCategoryRepository businessCategoryRepository;

    @ApiOperation(value = "查询所有分类")
    @GetMapping("/admin/basic/business/category/list/")
    public Result<List<BusinessCategoryVO>> allCategories(){//查询商家分类列表
        log.info("查询所有分类参数");
        List<BusinessCategoryVO> list = businessCategoryRepository.findAll();
        return new Result("0","查询成功",list);
    }
}
